package com.fpt.edu.vn.h2tv.dto;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang3.StringUtils;


@XmlRootElement
public class Book {
	private int bookId;
	private String picture;
	private String bookName;
	private double price;
	private String author;
	private String description;
	private short categoryId;
	private int quantity;
	private Long count;

	 @Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Book)) {
			return false;
		}
		Book otherBook = (Book) obj;
		if (this.bookId == otherBook.bookId
				&& StringUtils
						.equalsIgnoreCase(this.picture, otherBook.picture)
				&& StringUtils.equalsIgnoreCase(this.bookName,
						otherBook.bookName)
				&& StringUtils.equalsIgnoreCase(this.author, otherBook.author)
				&& StringUtils.equalsIgnoreCase(this.description,
						otherBook.description) && this.price == otherBook.price
				&& this.categoryId == otherBook.categoryId
				&& this.quantity == otherBook.quantity
				&& this.count == otherBook.count) {
			return true;
		} else {
			return false;
		}
	}

	public int getBookId() {
		return bookId;
	}

	@XmlElement
	public void setBookId(int bookId) {
		this.bookId = bookId;
	}

	public String getPicture() {
		return picture;
	}

	@XmlElement
	public void setPicture(String picture) {
		this.picture = picture;
	}

	public String getBookName() {
		return bookName;
	}

	@XmlElement
	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	public Double getPrice() {
		return price;
	}

	@XmlElement
	public void setPrice(Double price) {
		this.price = price;
	}

	public String getAuthor() {
		return author;
	}

	@XmlElement
	public void setAuthor(String author) {
		this.author = author;
	}

	public String getDescription() {
		return description;
	}

	@XmlElement
	public void setDescription(String description) {
		this.description = description;
	}

	public Short getCategoryId() {
		return categoryId;
	}

	@XmlElement
	public void setCategoryId(Short categoryid) {
		this.categoryId = categoryid;
	}

	public Integer getQuantity() {
		return quantity;
	}

	@XmlElement
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Long getCount() {
		return count;
	}

	@XmlElement
	public void setCount(Long count) {
		this.count = count;
	}

}
